Telegram Group & Telegram Channel
📚 Мини-справочник по основным типам данных C++

Делимся компактным справочником по основным типам данных в C++. Сохраняйте себе на будущее.

🔢 Целочисленные типы

int — 4 байта, от -2,147,483,648 до 2,147,483,647
short — 2 байта, от -32,768 до 32,767
long — 4 байта (Windows) или 8 байт (Unix)
long long — 8 байт, от -9,223,372,036,854,775,808 до 9,223,372,036,854,775,807

Модификаторы:
unsigned — только положительные числа, удваивает верхний предел
signed — со знаком (по умолчанию)

unsigned int counter = 100;
short temperature = -15;
long long population = 7800000000;


🔡 Символьные типы

char — 1 байт, обычные символы ASCII
wchar_t — 2 или 4 байта, широкие символы (Unicode)
char16_t — 2 байта, символы UTF-16 (C++11)
char32_t — 4 байта, символы UTF-32 (C++11)

char letter = 'A';
wchar_t unicodeChar = L'Ф';
char16_t utf16Char = u'Ж';


🔄 Числа с плавающей точкой

float — 4 байта, точность ~7 цифр, диапазон ±3.4e±38
double — 8 байт, точность ~15 цифр, диапазон ±1.7e±308
long double — 8-16 байт, точность ≥ double, диапазон зависит от компилятора

float price = 19.99f;   // 'f' суффикс для float
double pi = 3.14159265359;
long double precise = 1.23456789123456789L; // 'L' суффикс


🧮 Логический тип

bool — 1 байт, значения: true или false

bool isActive = true;
bool hasPermission = false;


🗄 Производные типы

Массивы: int numbers[5];
Указатели: int* ptr;
Ссылки: int& ref = value;
Строки:
• C-строки: char str[] = "Hello";
• std::string: std::string text = "Hello";

🔄 Автоматическое определение типа (C++11)

auto x = 10;        // int
auto y = 3.14; // double
auto z = "Hello"; // const char*


🧩 Тип Void

void — отсутствие типа (для функций без возвращаемого значения)
void* — указатель на данные любого типа

🔍 Как узнать размер типа


cout << "Размер int: " << sizeof(int) << " байт" << endl;


💡 Полезные советы

1. Используйте **size_t
для индексации и размеров
2. Для целых чисел с гарантированным размером используйте типы из <cstdint>: int32_t, uint64_t
3. Для денежных расчетов избегайте float из-за погрешностей округления

Библиотека C/C++ разработчика #буст



tg-me.com/cppproglib/5526
Create:
Last Update:

📚 Мини-справочник по основным типам данных C++

Делимся компактным справочником по основным типам данных в C++. Сохраняйте себе на будущее.

🔢 Целочисленные типы

int — 4 байта, от -2,147,483,648 до 2,147,483,647
short — 2 байта, от -32,768 до 32,767
long — 4 байта (Windows) или 8 байт (Unix)
long long — 8 байт, от -9,223,372,036,854,775,808 до 9,223,372,036,854,775,807

Модификаторы:
unsigned — только положительные числа, удваивает верхний предел
signed — со знаком (по умолчанию)

unsigned int counter = 100;
short temperature = -15;
long long population = 7800000000;


🔡 Символьные типы

char — 1 байт, обычные символы ASCII
wchar_t — 2 или 4 байта, широкие символы (Unicode)
char16_t — 2 байта, символы UTF-16 (C++11)
char32_t — 4 байта, символы UTF-32 (C++11)

char letter = 'A';
wchar_t unicodeChar = L'Ф';
char16_t utf16Char = u'Ж';


🔄 Числа с плавающей точкой

float — 4 байта, точность ~7 цифр, диапазон ±3.4e±38
double — 8 байт, точность ~15 цифр, диапазон ±1.7e±308
long double — 8-16 байт, точность ≥ double, диапазон зависит от компилятора

float price = 19.99f;   // 'f' суффикс для float
double pi = 3.14159265359;
long double precise = 1.23456789123456789L; // 'L' суффикс


🧮 Логический тип

bool — 1 байт, значения: true или false

bool isActive = true;
bool hasPermission = false;


🗄 Производные типы

Массивы: int numbers[5];
Указатели: int* ptr;
Ссылки: int& ref = value;
Строки:
• C-строки: char str[] = "Hello";
• std::string: std::string text = "Hello";

🔄 Автоматическое определение типа (C++11)

auto x = 10;        // int
auto y = 3.14; // double
auto z = "Hello"; // const char*


🧩 Тип Void

void — отсутствие типа (для функций без возвращаемого значения)
void* — указатель на данные любого типа

🔍 Как узнать размер типа


cout << "Размер int: " << sizeof(int) << " байт" << endl;


💡 Полезные советы

1. Используйте **size_t
для индексации и размеров
2. Для целых чисел с гарантированным размером используйте типы из <cstdint>: int32_t, uint64_t
3. Для денежных расчетов избегайте float из-за погрешностей округления

Библиотека C/C++ разработчика #буст

BY Библиотека C/C++ разработчика | cpp, boost, qt


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/cppproglib/5526

View MORE
Open in Telegram


Библиотека C C разработчика | cpp boost qt Telegram | DID YOU KNOW?

Date: |

Export WhatsApp stickers to Telegram on iPhone

You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.

Telegram Be The Next Best SPAC

I have no inside knowledge of a potential stock listing of the popular anti-Whatsapp messaging app, Telegram. But I know this much, judging by most people I talk to, especially crypto investors, if Telegram ever went public, people would gobble it up. I know I would. I’m waiting for it. So is Sergei Sergienko, who claims he owns $800,000 of Telegram’s pre-initial coin offering (ICO) tokens. “If Telegram does a SPAC IPO, there would be demand for this issue. It would probably outstrip the interest we saw during the ICO. Why? Because as of right now Telegram looks like a liberal application that can accept anyone - right after WhatsApp and others have turn on the censorship,” he says.

Библиотека C C разработчика | cpp boost qt from sg


Telegram Библиотека C/C++ разработчика | cpp, boost, qt
FROM USA